/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙，邂逅框架梦]
 * 
 * https://zhiqim.org/project/zhiqim_framework/zhiqim_kernel.htm
 *
 * Zhiqim Kernel is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
package org.zhiqim.kernel.model.objects;

import org.zhiqim.kernel.json.Jsons;

/**
 * 长整型定义，含编码、名称和描述，用于需要描述值时的常量或变量
 * 
 * @version v1.0.0 @author zouzhigang 2014-2-27 新建与整理
 */
public final class Lon2
{
    private long code;
    private String msg;
    private String msg2;
    
    public Lon2()
    {
    }
    
    public Lon2(long code, String msg, String msg2)
    {
        this.code = code;
        this.msg = msg;
        this.msg2 = msg2;
    }
    
    public long code()
    {
        return code;
    }
    
    public String msg()
    {
        return msg;
    }
    
    public String msg2()
    {
        return msg2;
    }
    
    public Lon2 code(int code)
    {
        this.code = code;
        return this;
    }
    
    public Lon2 msg(String msg)
    {
        this.msg = msg;
        return this;
    }
    
    public Lon2 msg2(String msg2)
    {
        this.msg2 = msg2;
        return this;
    }
    
    public boolean zero()
    {
        return code == 0;
    }
    
    public String toString()
    {
        return Jsons.toString(this);
    }
}

